package com.lx.oms.controller.manager.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.lx.oms.common.entity.Page;
import com.lx.oms.common.entity.Query;
import com.lx.oms.common.utils.Utils;
import com.lx.oms.controller.dao.QuotationTrendMapper;
import com.lx.oms.controller.entity.QuotationTrendEntity;
import com.lx.oms.controller.manager.QuotationTrendManager;

/**
 * 行情走势
 *
 * @author houzhong
 * @date 2018年7月16日 下午2:35:20
 */
@Component("quotationTrendManager")
public class QuotationTrendManagerImpl implements QuotationTrendManager {

	@Autowired
	private QuotationTrendMapper quotationTrendMapper;
	

	@Override
	public List<QuotationTrendEntity> listQuotationTrend(Page<QuotationTrendEntity> page, Query search) {
		return quotationTrendMapper.listForPage(page, search);
	}

	@Override
	public int saveQuotationTrend(QuotationTrendEntity quotationTrend) {
		if (quotationTrend.getId() == null) {
			quotationTrend.setId(Utils.id().toString());
		}
		return quotationTrendMapper.save(quotationTrend);
	}

	@Override
	public QuotationTrendEntity getQuotationTrendById(BigInteger id) {
		QuotationTrendEntity quotationTrend = quotationTrendMapper.getObjectById(id);
		return quotationTrend;
	}

	@Override
	public int updateQuotationTrend(QuotationTrendEntity quotationTrend) {
		return quotationTrendMapper.update(quotationTrend);
	}

	@Override
	public int batchRemove(String[] id) {
		int count = quotationTrendMapper.batchRemove(id);
		return count;
	}
	
}
